<?php

defined( 'PDNS_AUTH' ) or die( "Unauthorized" );

class Controller{
	protected function getModel( ){
		$section = Router::getSection();

		require_once( "models/$section.php" );
		$class = $section."Model";
		return new $class;
	}

	protected function displayView( $name='', $model=null ){
		$section = Router::getSection();
		$view = $name? "views/$section.$name.php" : "views/$section.php"; 
		require_once( $view );
	}

	/*
	 * this is a stub
	 * your child class must implement this!
	 */
	public function action( $action ){

	}
}
